const { defineConfig } = require('@vue/cli-service')
const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  devServer: {  
    proxy: {  
      '/api': {  
        target: 'http://localhost:8081',  
        changeOrigin: true,  
        pathRewrite: {  
          '^/api': '' // 去除路径中的 /api  
        }  
      },
      '/x': {  
        target: 'https://api.bilibili.com', // 假设这是bilibili相关API的服务器地址  
        headers: {
          "Referer": "https://api.bilibili.com",
      },
      },  
    },
  },
  chainWebpack: (config) => {
    config.resolve.alias.set('@', resolve('src'))
  }
})
